Skip to content

Reland: [Android] Fix View accessibility payloads that Props 2.0 sends wrong or drops - #59387

Open
bartlomiejbloniarz wants to merge 1 commit into
mainfrom
export-D126922843
Open

bartlomiejbloniarz wants to merge 1 commit into
mainfrom
export-D126922843

Conversation

@bartlomiejbloniarz

Copy link
Copy Markdown
Contributor

Summary:
Reland of #59079. It was reverted because code outside this repository that compiles against these headers still read role as a plain Role and stopped compiling.

With Props 2.0 on Android (enableExclusivePropsUpdateAndroid and the related flags), BaseViewManager receives the View payload from getDiffProps. Some accessibility props come out wrong:

  • Changing one member of accessibilityState, such as busy: only that member is sent, and Java treats the map as the whole state, so a selected, disabled view becomes unselected and enabled.
  • A removed accessibilityRole or role: not cleared.
  • An explicit role="none": not sent on mount, so the view falls back to accessibilityRole.
  • A removed accessibilityValue: sent as {}, so the old value stays in the content description.

This PR sends accessibilityState in full, clears a removed role or value, and makes role optional so that unset and "none" differ. Nothing changes on Android with the flags off. iOS shares the props constructor, so a removed role is now also cleared in its C++ props. I didn't test iOS.

Changelog:

[ANDROID] [FIXED] - Fix accessibilityState, a removed accessibilityRole, role or accessibilityValue, and role="none" with Props 2.0

Differential Revision: D126922843

…s wrong or drops

Summary:
Reland of #59079. It was reverted because code outside this repository that compiles against these headers still read `role` as a plain `Role` and stopped compiling.

With Props 2.0 on Android (`enableExclusivePropsUpdateAndroid` and the related flags), `BaseViewManager` receives the View payload from `getDiffProps`. Some accessibility props come out wrong:

- Changing one member of `accessibilityState`, such as `busy`: only that member is sent, and Java treats the map as the whole state, so a selected, disabled view becomes unselected and enabled.
- A removed `accessibilityRole` or `role`: not cleared.
- An explicit `role="none"`: not sent on mount, so the view falls back to `accessibilityRole`.
- A removed `accessibilityValue`: sent as `{}`, so the old value stays in the content description.

This PR sends `accessibilityState` in full, clears a removed role or value, and makes `role` optional so that unset and `"none"` differ. Nothing changes on Android with the flags off. iOS shares the props constructor, so a removed role is now also cleared in its C++ props. I didn't test iOS.

## Changelog:

[ANDROID] [FIXED] - Fix accessibilityState, a removed accessibilityRole, role or accessibilityValue, and role="none" with Props 2.0

Differential Revision: D126922843
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 23, 2026
@facebook-github-tools facebook-github-tools Bot added p: Software Mansion Partner: Software Mansion Partner p: Facebook Partner: Facebook labels Oct 23, 2026
@meta-codesync

meta-codesync Bot commented Oct 23, 2026

Copy link
Copy Markdown

@bartlomiejbloniarz has exported this pull request. If you are a Meta employee, you can view the originating Diff in D126922843.

@github-actions

Copy link
Copy Markdown

Visual regression

No visual differences at c381c13a1a6d.

android: no capture

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported p: Facebook Partner: Facebook p: Software Mansion Partner: Software Mansion Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant